package com.ruoyi.web.controller.datastatistics;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.basedata.domain.Concentrator;
import com.ruoyi.basedata.domain.TerminalsDb;
import com.ruoyi.basedata.domain.TerminalsXb;
import com.ruoyi.basedata.mapper.ConcentratorMapper;
import com.ruoyi.basedata.mapper.TerminalTypeMapper;
import com.ruoyi.basedata.mapper.TerminalsDbMapper;
import com.ruoyi.basedata.mapper.TerminalsXbMapper;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.datastatistics.domain.MeterHistoryData;
import com.ruoyi.datastatistics.domain.TerminalHistoryData;
import com.ruoyi.datastatistics.mapper.MeterHistoryDataMapper;
import com.ruoyi.datastatistics.mapper.TerminalHistoryDataMapper;
import com.ruoyi.datastatistics.service.IDashBoardService;
import com.ruoyi.datastatistics.service.IMeterHistoryDataService;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 小-历史数据Controller
 *
 * @author ruoyi
 * @date 2023-09-06
 */
@RestController
@RequestMapping("/dashboardScreen")
public class DashBoardController extends BaseController {
    @Autowired
    private IDashBoardService dashBoardService;


    @Anonymous
    @GetMapping("/getData")
    public AjaxResult getData(@RequestParam("tenantId") String tenantId) throws ParseException {
        Map<String, Object> resultMap = dashBoardService.getData(tenantId);
        return success(resultMap);
    }
}
